package service

import (
	"admin-system/internal/dao"
	"admin-system/internal/service/auth_svc"
	"gorm.io/gorm"
)

type Service struct {
	DB         *gorm.DB
	dao        *dao.DaoProvider
	Admin      *auth_svc.AdminService
	Menu       *auth_svc.MenuService
	Permission *auth_svc.PermissionService
	Role       *auth_svc.RoleService
}

func NewService(DB *gorm.DB) *Service {
	daoProvider := dao.NewDaoProvider(DB)
	return &Service{
		Admin:      auth_svc.NewAdminService(daoProvider),
		Menu:       auth_svc.NewMenuService(daoProvider),
		Permission: auth_svc.NewPermissionService(daoProvider),
		Role:       auth_svc.NewRoleService(daoProvider),
	}
}
